var publishPerson = {};
publishPerson.list = [];
//订阅的消息
publishPerson.listen = function(fn){
    this.list.push(fn);
};
//触发(发布通知)消息
publishPerson.trigger = function(color, size){
    for(var i = 0; i < this.list.length; i++){
        this.list[i](color, size);
    }
}

publishPerson.listen(function(color, size){
    console.log("颜色是: ", color);
    console.log("大小是: ", size);
});
publishPerson.listen(function(color, size){
    console.log("再次打印颜色是: ", color);
    console.log("再次打印的大小是: ", size);
});
publishPerson.trigger("红色", 40);
publishPerson.trigger("黑色", 42);